home *** CD-ROM | disk | FTP | other *** search
/ PC Open 103 / PC Open 103 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_input_checkbox.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-04-09  |  4.7 KB  |  94 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="430" height="250" caption="Checkbox">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <label name="lblValue" caption="Text/value" hint="Text/value of your form element." width="69" height="13" top="8" left="200"/>
  6.             <label name="lblName" caption="Name" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="29" height="13" top="8" left="8"/>
  7.             <edit name="edtName" taborder="0" text="" hint="The name of this element. Important if you wish to refer to this form element through some sort of scripting for instance. This field is required." width="175" height="19" top="24" left="8"/>
  8.             <edit name="edtValue" taborder="1" text="" hint="Text/value of your form element." width="175" height="19" top="24" left="200"/>
  9.             <checkbox name="cbCheck" caption="Checked" taborder="4" hint="Select whether your element should be checked by default or not. The user can change this, unless the element is disabled or readonly." checked="0" width="91" height="17" top="56" left="278"/>
  10.             <checkbox name="cbDisabled" caption="Disabled" taborder="3" hint="Your element will be visible, but disabled." checked="0" width="121" height="17" top="56" left="140"/>
  11.             <checkbox name="cbReadonly" caption="Readonly" taborder="2" hint="If your element is readonly, the user will not be able to make any changes to it." checked="0" width="121" height="17" top="56" left="8"/>
  12.         </panel>
  13.     </controls>
  14.     <dialogevents>
  15.         <event type="onclose" resulttype="ok">
  16.  
  17.             StartCode := ('<input type="checkbox"');
  18.             if edtName.Text > '' then
  19.              StartCode := StartCode + (' name="'+(edtName.Text)+'"');
  20.             if edtValue.Text > '' then
  21.              StartCode := StartCode + ' value="'+edtValue.Text+'"';
  22.             if cbReadonly.Checked then
  23.              StartCode := StartCode + (' readonly');
  24.             if cbDisabled.Checked then
  25.              StartCode := StartCode + (' disabled');
  26.             if cbCheck.Checked then
  27.              StartCode := StartCode + (' checked');
  28.  
  29.  
  30.               If edtCSSClass.Text <> '' then
  31.              StartCode := StartCode + ' class="'+edtCSSClass.Text+'"';
  32.               If edtCSSId.Text <> '' then
  33.                StartCode := StartCode + ' ID="'+edtCSSId.Text+'"';
  34.               If edtCSSStyle.Text <> '' then
  35.                StartCode := StartCode + ' style="'+edtCSSStyle.Text+'"';
  36.             for i := 0 to EventGrid.Count - 1 do
  37.               begin
  38.               if EventGrid.Rows[i].EditText <> '' then
  39.                StartCode := StartCode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  40.              end;
  41.  
  42.             StartCode := StartCode + '>';
  43.             If cbMakeXHTMLCompliant.Checked then
  44.              StartCode := MakeXHTMLCompliant(StartCode, false);
  45.             If cbDoPHPEscape.Checked then
  46.              StartCode := DoPHPEscape(StartCode);
  47.             // A little "hack" - WebCoder will set this, to let us know whether to update
  48.             // an existing tag, or insert a brand new one
  49.             If cbUpdateExistingTag.Checked then
  50.              ReplaceTag(StartCode)
  51.             else
  52.                InsertTags(StartCode, '');
  53.  
  54.         </event>
  55.         <event type="onshow">
  56.             // Lets put the advanced panel in the right place
  57.             pnlAdvanced.Parent := MainPanel;
  58.             pnlAdvanced.Left := 8;
  59.             pnlAdvanced.Top := MainPanel.Height - 32;
  60.             pnlAdvanced.Width := Self.Width - 36;
  61.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  62.             If pnlAdvanced.Height > 20 then
  63.              Self.Height := Self.Height + 200;
  64.         </event>
  65.         <event type="updatedialog">
  66.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  67.             // The entire selected tag will be passed as a parameter to this function, that should update
  68.             // the required fields of the dialog.
  69.             function UpdateDialog(Tag: string);
  70.              begin
  71.  
  72.               edtName.Text := GetValueFromAttribute(Tag, 'name');
  73.               edtValue.Text := GetValueFromAttribute(Tag, 'value');
  74.  
  75.               cbReadonly.Checked := HasOption(Tag, 'readonly');
  76.               cbDisabled.Checked := HasOption(Tag, 'disabled');
  77.               cbCheck.Checked := HasOption(Tag, 'checked');
  78.               
  79.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  80.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  81.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  82.               for i := 0 to EventGrid.Count - 1 do
  83.                 begin
  84.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  85.                  If EventVal <> '' then
  86.                   EventGrid.Rows[i].EditText := EventVal;
  87.                end;
  88.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  89.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();
  90.              end;
  91.         </event>
  92.     </dialogevents>
  93. </dialog>
  94.